<!doctype html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
	<link rel="icon" href="https://static.nowcoder.com/images/logo_87_87.png"/>
	<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" crossorigin="anonymous">
	<link rel="stylesheet" th:href="@{/css/global.css}" />
	<title>搜索结果</title>
</head>
<body>
	<div class="nk-container">
		<!-- 头部 -->
		<header class="bg-dark sticky-top" th:replace="index::header">
		</header>

		<!-- 内容 -->
		<div class="main">
			<div class="container">
				<h6><b class="square"></b> 搜索结果</h6>

				<div th:if="${postList.size()==0}" style="padding-top: 50px;padding-bottom: 50px;text-align: center">
					<span class="text-muted font-size-14" style="font-weight: lighter">空空如也~</span><br/>
					<img th:src="@{/img/nothing.png}" >
				</div>

				<!-- 帖子列表 -->
				<ul class="list-unstyled mt-4">
					<li class="media pb-3 pt-3 mb-3 border-bottom" th:each="postVo:${postList}">
						<img th:src="${postVo.user.headerUrl}" style="width:50px;height:50px;" class="mr-4 rounded-circle" alt="用户头像">
						<div class="media-body">
							<h6 class="mt-0 mb-3">
								<a th:href="@{|/discuss/detail/${postVo.post.id}|}" th:utext="${#strings.length(postVo.post.title)>120?#strings.substring(postVo.post.title,0,120)+'...':postVo.post.title}"></a>
							</h6>
							<div class="mb-3" th:utext="${#strings.length(postVo.post.content)>200?#strings.substring(postVo.post.content,0,200)+'...':postVo.post.content}">
							</div>
							<div class="text-muted font-size-12">
								<u class="mr-3" th:utext="${postVo.user.username}">寒江雪</u> 发布于 <b th:text="${#dates.format(postVo.post.createTime,'yyyy-MM-dd')}">2019-04-15 15:32:18</b>
								<ul class="d-inline float-right">
									<li class="d-inline ml-2">赞 <i th:text="${postVo.likeCount}"></i></li>
									<li class="d-inline ml-2">|</li>
									<li class="d-inline ml-2" >回复 <i th:text="${postVo.post.commentCount}"></i></li>
								</ul>
							</div>
						</div>
					</li>
				</ul>
				<!-- 分页 -->
				<nav class="mt-5" th:replace="index::page">
				</nav>
			</div>
		</div>

		<!-- 尾部 -->
		<footer class="bg-dark" th:replace="index::footer">
		</footer>
	</div>

	<script src="https://code.jquery.com/jquery-3.3.1.min.js" crossorigin="anonymous"></script>
	<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" crossorigin="anonymous"></script>
	<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" crossorigin="anonymous"></script>
	<script th:src="@{/js/global.js}"></script>
</body>
</html>
